<?php
/*
 * Created on 2016-10-30
 * 
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 	session_start();
 	require_once('../service/InsertUser.class.php');
 	$userName = $_POST["regeUser"];
 	$email = $_POST["regeEmail"];
 	$pwd = $_POST["regePawd"];
 	$returnValue = "";
 	try{
 		$register = new InsertUser();
 		$resultquery = $register -> query($userName, $email);
 		if(!$resultquery){
 			$returnValue = $register -> insertUsers($userName, $email, md5($pwd));
 			$result = $register -> queryUser($userName,md5($pwd));//获取用户信息
 			$_SESSION["userInfo"]=$result;
 			echo $returnValue;
 			exit;
 		}else{
 			echo 3;
 			exit;
 		}
 		
 	}catch(Exception $e){
 		echo "0";
 	}
 	
?>
